Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/anyevent_closed_connection.t kills server before event loop is ready #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ISim
Copy link

@ISim ISim commented Apr 3, 2015

I was hacking Twiggy and found that the test t/anyevent_closed_connection.t kills server before server is ready to accept connection. So, the test do not test what should be tested.
It can be simply examined with TWIGGY_DEBUG:

$ TWIGGY_DEBUG=1 prove -l t/anyevent_closed_connection.t
t/anyevent_closed_connection.t .. Listening on 127.0.0.1:51403
t/anyevent_closed_connection.t .. ok  
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.09 cusr  0.04 csys =  0.15 CPU)
Result: PASS

I added sleep(0) to test file.
Now, server accepts connection, request is parsed and responder is called:

$ TWIGGY_DEBUG=1 prove -l t/anyevent_closed_connection.t
t/anyevent_closed_connection.t .. Listening on 127.0.0.1:51257
GLOB(0x1a4ef50) Accepted connection from 127.0.0.1:35045
GLOB(0x1a4f070) Accepted connection from 127.0.0.1:35046
GLOB(0x1a4f070) Parsed HTTP headers: request length=63
t/anyevent_closed_connection.t .. ok  
All tests successful.
Files=1, Tests=1,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.10 cusr  0.04 csys =  0.16 CPU)
Result: PASS

* without delay the server is killed before loop is started
@ISim
Copy link
Author

ISim commented Apr 7, 2015

Weird error in Travis CI build for perl 5.18.2: module IO::Socket::IP not found in Net::EmptyPort module used for tests.
Probably installation of dependencies via cpanm failed for unknown reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant